package cn.me.alphamq.common.entity.req;

import cn.me.alphamq.common.entity.BaseMsg;
import cn.me.alphamq.common.enumeration.BrokerRoleEnum;

/**
 * 拉取 broker 的地址的请求对象
 *
 * @author f
 */
public class PullBrokerAddressReq extends BaseMsg {

    /**
     * 待拉取的 broker 的角色
     */
    private String role;

    /**
     * broker 的组名
     */
    private String brokerGroup;

    public PullBrokerAddressReq() {
    }

    public PullBrokerAddressReq(String brokerGroup) {
        if (brokerGroup == null) {
            this.role = BrokerRoleEnum.SINGLE.getCode();
        } else {
            this.role = BrokerRoleEnum.MASTER.getCode();
            this.brokerGroup = brokerGroup;
        }
    }

    public PullBrokerAddressReq(String role, String brokerGroup) {
        this.role = role;
        this.brokerGroup = brokerGroup;
    }

    public String getRole() {
        return role;
    }

    public void setRole(String role) {
        this.role = role;
    }

    public String getBrokerGroup() {
        return brokerGroup;
    }

    public void setBrokerGroup(String brokerGroup) {
        this.brokerGroup = brokerGroup;
    }
}
